<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>process loading</title>
    <script type="text/javascript" src="./js/require.js"></script>
    <script type="text/javascript" src="./js/main.js"></script>
    <link rel="stylesheet" type="text/css" href="../src/css/toolbar.css"/>
</head>
<body>
<div>
    <fieldset>文本：<span class="i-edit" data-field="title" data-id="1">abc123</span></fieldset>
    <fieldset>文本域：<span class="i-edit" data-field="remark" data-id="2" style="width: 300px;">阳光把云朵晒得软绵绵的
路过街角发现樱花偷偷开了半树
风一吹就飘起粉色的雪
连空气里都裹着淡淡的甜
穿件宽松的针织开衫出门</span>
    </fieldset>
    <fieldset>复选框：<span class="i-edit" data-field="show" data-id="1" data-type="bool">是</span></fieldset>
    <fieldset>日期：<span class="i-edit" data-field="date" data-id="1" data-type="date">2025-5-1</span></fieldset>
    <fieldset>下拉框：<span class="i-edit" data-field="user" data-id="1" data-type="select" data-ref="select-id" data-value="1">张三</span>
    </fieldset>
</div>
<div style="display: none;" id="select-id">
    <select>
        <option value="">--请选择--</option>
        <option value="1">张三</option>
        <option value="2">李四</option>
        <option value="3">王五</option>
    </select>
</div>
<script type="text/javascript">
    require(['batchEdit'], function () {
        $('.i-edit').batchEdit({
            url: 'batchEdit.json',
            input: function (val) {
                console.log(val);
            },
            click: function () {

            },
            params: function (input, val) {
                return {
                    id: $(this).data('id'),
                    field: $(this).data('field'),
                    val: $(input).val()
                };
            }
        });
    });
</script>
</body>
</html>